hysop.operator.advection module

@file advection.py Advection operator generator.

class hysop.operator.advection.Advection(velocity, advected_fields, variables, dt, advected_fields_out=None, implementation=None, base_kwds=None, **kwds)[source]

Bases: ComputationalGraphNodeFrontend

Interface the Scales fortran advection solver. Available implementations are: Fortran

Available remeshing formulas:

  • ‘p_O2’ : order 4 method, corrected to allow large CFL number, untagged particles

  • ‘p_O4’ : order 4 method, corrected to allow large CFL number, untagged particles

  • ‘p_L2’ : limited and corrected lambda 2

  • ‘p_M4’ : Lambda_2,1 (=M’4) 4 point formula

  • ‘p_M6’ (default) : Lambda_4,2 (=M’6) 6 point formula

  • ‘p_M8’ : M8prime formula

  • ‘p_44’ : Lambda_4,4 formula

  • ‘p_64’ : Lambda_6,4 formula

  • ‘p_66’ : Lambda_6,6 formula

  • ‘p_84’ : Lambda_8,4 formula

Time integration:

  • Runge-Kutta 2nd order

Splitting:

Computations are performed with a dimensional splitting as follows:

  • ‘strang’ (2nd order):

    • X-dir, half time step

    • Y-dir, half time step

    • Z-dir, full time step

    • Z-dir, full time step

    • Y-dir, half time step

    • X-dir, half time step

  • ‘classic’ (1st order):

    • X-dir, full time step

    • Y-dir, full time step

    • Z-dir, full time step

Initialize a DirectionalAdvectionFrontend.

Parameters:
  • velocity (Field) – continuous velocity field (all components)

  • advected_fields (Field or array like of Fields) – instance or list of continuous fields to be advected.

  • advected_fields_out (Field or array like of Field, optional, defaults to None) – advection output, if set to None, advection is done inplace on a per variable basis.

  • variables (dict) – Dictionary of continuous fields as keys and topologies as values.

  • dt (ScalarParameter) – Timestep parameter that will be used for time integration.

  • implementation (implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • kwds – Extra parameters passed to generated directional operators.

Notes

An implementation should at least support the following __init__ parameters:

velocity, advected_fields, advected_fields_out, variables direction, splitting_dim

Extra keywords parameters are passed through kwds.

classmethod default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

classmethod implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.